<%-- 
    Document   : user_pestanas
    Created on : 10-27-2010, 07:36:01 PM
    Author     : Dada
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<HTML>
<HEAD>
<TITLE>Asociar por Excel</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="fileuploadfield.css"/>

<script type="text/javascript" src="javascript/ext-base.js"></script>

<script type="text/javascript" src="javascript/ext-all.js"></script>
<script type="text/javascript" src="javascript/FileUploadField.js"></script>


<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
<!--

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		butt_01_over = newImage("images/butt_01-over.jpg");
		butt_02_over = newImage("images/butt_02-over.jpg");
		butt_03_over = newImage("images/butt_03-over.jpg");
		butt_04_over = newImage("images/butt_04-over.jpg");
		butt_05_over = newImage("images/butt_05-over.jpg");
		butt_06_over = newImage("images/butt_06-over.jpg");
		preloadFlag = true;
	}
}

// -->

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

Ext.onReady(function(){

    Ext.QuickTips.init();
    var msg = function(title, msg){
        Ext.Msg.show({
            title: title,
            msg: msg,
            minWidth: 200,
            modal: true,
            icon: Ext.Msg.INFO,
            buttons: Ext.Msg.OK
        });
    };

    var fp = new Ext.FormPanel({
        renderTo: 'uploadFile',
        fileUpload: true,
        width: 400,
        frame: true,
        autoHeight: true,
        bodyStyle: 'padding: 10px 10px 0 10px;',
        labelWidth: 50,
        defaults: {
            anchor: '95%',
            allowBlank: false,
            msgTarget: 'side'
        },
        items: [{
            xtype: 'fileuploadfield',
            id: 'file',
            anchor:'98%',
            emptyText: 'Seleccione el archivo',

            fieldLabel: 'Archivo',
            name: 'file',
            buttonText: '',
            buttonCfg: {
                iconCls: 'upload-icon'
            }
        }],
        buttons: [{
            text: 'Asociar',
            handler: function(){
                if(fp.getForm().isValid()){
                        var idCampana=document.getElementById("idCampana").value;
                        var nombre=document.getElementById("nombre").value;
                        var mensaje=document.getElementById("mensaje").value;
                        var empleado=document.getElementById("empleado").value;
                        var fecha1=document.getElementById("fecha1").value;
                        var fecha2=document.getElementById("fecha2").value;

	                fp.getForm().submit({
	                    url: 'CampanaServlet?action=asociar_excel',
                            params: {
                                    idCampana:idCampana,
                                    nombre:nombre,
                                    mensaje:mensaje,
                                    empleado:empleado,
                                    fecha1:fecha1,
                                    fecha2:fecha2

                            },
	                    waitMsg: 'Subiendo archivo...',
	                    success: function(fp, o){
	                        msg('Success', 'Asocio exitosamente');
                                window.location="CampanaServlet"
	                    }
	                });
                }
            }
        },{
            text: 'Limpiar',
            handler: function(){
                fp.getForm().reset();
            }
        }]
    });





});


//-->
</SCRIPT>
<link href="general.css" rel="stylesheet" type="text/css">
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY BGCOLOR=#133F54 ONLOAD="preloadImages();" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
  <TABLE WIDTH=774 BORDER=1 CELLPADDING=0 CELLSPACING=0>
    <TR>
      <TD width="178" height="218" align="center" valign="middle" class="logo"><p><strong>Chasqui-soft</strong></p>
      <p><img src="images/defaultlogo.gif" width="48" height="48" alt="logo"></p></TD>
      <TD width="590" align="left" valign="top"><img src="images/callcenter_banner.jpg" width="1009" height="216" alt="banner"></TD>
    </TR>
    <TR>
      <TD height="152"><img src="images/info_area.jpg" alt="back" width=178 height=270></TD>
      <TD rowspan="3" align="center" valign="top"><table width="500" height="516" border="0" cellspacing="0">
        <tr>
          <td width="583" height="516" align="center" valign="top" scope="col"><p>&nbsp;</p>
            <p>&nbsp;</p>
            <p class="Titlulos_General">Asociar por Excel</p>
            <p class="Titlulos_General">&nbsp;</p>
            <p class="Titlulos_General"><img src="images/t_19.jpg" width="500" height="2" alt="serparador"></p>
            <p class="Titlulos_General">&nbsp;</p>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=900>
        <TR>
          <td width="1046" valign="top"><table width="894" height="194" border="0" cellpadding="0" cellspacing="0">
            <form method="post" action="CampanaServlet" enctype="multipart/form-data">
              <input type="hidden" id="idCampana" name="idCampana" value="${idCampana}">
              <input type="hidden" id="nombre" name="nombre" value="${nombre}">
              <input type="hidden" id="mensaje" name="mensaje" value="${mensaje}">
              <input type="hidden" id="empleado" name="empleado" value="${empleado}">
              <input type="hidden" id="fecha1" name="fecha1" value="${fecha1}">
              <input type="hidden" id="fecha2" name="fecha2" value="${fecha2}">
              <tr>
                <td height="43" colspan="4"><input type="hidden" name="action" value="asociar_excel"></td>
                </tr>
              <tr>
                <td width="50" height="22">&nbsp;</td>
                <td width="150" class="texto">Archivo:<td colspan="2" align="left" valign="middle">
                <img src="images/excel-logomages.thumbnail.jpeg" width="20" height="20" alt="icono">

                <div id="uploadFile"></div>

                </td>
                </tr>
              <tr>
                <td height="41" rowspan="2">&nbsp;</td>
                <td rowspan="2">&nbsp;</td>
                <td height="20" colspan="2">&nbsp;</td>
                </tr>
              <tr>
              <td>&nbsp;</td>
              </tr>
              <tr>
                <td height="3" colspan="4" align="center" valign="middle"><span class="Titlulos_General"><img src="images/t_19.jpg" width="500" height="1" alt="serparador"></span></td>
                </tr>
              <tr>
                <td height="44">&nbsp;</td>
                <td>&nbsp;</td>
                <td width="310" height="44" align="right">
                    <input name="ec6" type="submit" id="ec6" onClick="MM_popupMsg('Las l&iacute;neas se agregaron exitosamente')" value="  Asociar  "></td>
                <td width="191">&nbsp;</td>
              </tr>
            </form>
            </table></td>
        </TR>
        </TABLE></td>
        </tr>
      </table></TD>
    </TR>
    <TR>
      <TD height="208" valign="top"><ul id="MenuBar1" class="MenuBarVertical">
        <li><a href="index2.jsp">Home</a>          </li>
        <li><a href="clientes2.jsp">Clientes</a></li>
        <li><a href="usuario2.jsp" class="MenuBarItemSubmenu">Administraci&oacute;n</a>
          <ul>
            <li><a href="AbonadoServlet">Abonados</a></li>
            <li><a href="CampanaServlet">Campa&ntilde;as</a></li>
            <li><a href="modificar_usuario.jsp">Empleados</a></li>
            <li><a href="ReportesServlet?action=listreportes">Reportes</a></li>
           	<li><a href="CampanaServlet?action=volverusuario">Cerrar Sesi&oacute;n</a></li>
          </ul>
        </li>
        <li><a href="noticias2.jsp">Noticias</a></li>
        <li><a href="soporte2.jsp">Soporte</a></li>
        <li><a href="contactanos2.jsp">Cont&aacute;ctanos</a></li>
      </ul></TD>
    </TR>
    <TR>
      <TD height="169" valign="top"><img src="images/info_area.jpg" alt="back" width=178 height=270></TD>
    </TR>
  </TABLE>
</div>
<!--Jansondesigns.com offers an impressive collection of professionally made web templates, banner templates,
flash designs, free templates and free web graphics. We have templates that suit any personal or professional web site needs!! -->
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</BODY>
</HTML>
